package com.ikingtech.framework.sdk.attachment.api;

import com.ikingtech.framework.sdk.attachment.model.AttachmentDTO;
import com.ikingtech.framework.sdk.attachment.model.AttachmentQueryParamDTO;
import com.ikingtech.framework.sdk.base.model.BatchParam;
import com.ikingtech.framework.sdk.core.response.R;
import com.ikingtech.framework.sdk.web.annotation.PostRequest;
import io.swagger.v3.oas.annotations.Parameter;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @author tie yan
 */
public interface AttachmentApi {

    @PostRequest(order = 1, value = "/save-or-update", summary = "批量更新", description = "批量更新")
    R<Object> saveOrUpdate(@Parameter(name = "attachment", description = "新增参数")
                                       @RequestBody AttachmentDTO attachments);

    @PostRequest(order = 2, value = "/delete/batch", summary = "批量删除(业务编号集合)", description = "批量删除(业务编号集合)")
    R<Object> deleteBatch(@Parameter(name = "ids", description = "删除参数")
                                 @RequestBody BatchParam<String> businessIds);

    @PostRequest(order = 4, value = "/detail", summary = "详情", description = "详情")
    R<AttachmentDTO> detail(@Parameter(name = "id", description = "主键编号")
                                   @RequestBody String id);

    @PostRequest(order = 5, value = "/list/page", summary = "分页查询", description = "分页查询")
    R<List<AttachmentDTO>> page(@Parameter(name = "queryParam", description = "查询参数")
                                       @RequestBody AttachmentQueryParamDTO queryParam);

    @PostRequest(order = 6, value = "/list/all", summary = "全量查询", description = "全量查询")
    R<List<AttachmentDTO>> all();

    @PostRequest(order = 6, value = "/list/business-id", summary = "查询附件(业务编号)", description = "查询附件(业务编号)")
    R<List<AttachmentDTO>> listByBusinessId(String businessId);

    @PostRequest(order = 6, value = "/list/business-ids", summary = "查询附件(业务编号集合)", description = "查询附件(业务编号集合)")
    R<List<AttachmentDTO>> listByBusinessIds(BatchParam<String> businessIds);
}
